<?php

namespace App\Http\Requests\Backend\Message;

use Illuminate\Foundation\Http\FormRequest;

class MessageSendRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'type'=>'required|in:1,2,3',
            'template_id'=>'required|integer',
            'title'=>'required',
            'content'=>'required',
            'desc'=>'required',
            'key_word'=>'required_with:url',
            'url'=>'required_with:key_word',
        ];
    }
}
